import "./App.css";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import routes from "./Router";
import CacheRoute, { CacheSwitch } from 'react-router-cache-route'
import { Provider } from "react-redux";
import store from './store/index'
import Kinddetail from "./views/Kinddetail"; //详情页
// import store from "./store";
function App() {
  return (
    <Provider  store={ store }>
      <BrowserRouter>
        <>
          <Switch>
          {/* <CacheRoute path='/kinddetail' component={ Kinddetail } exact />   */}
          
            {routes.map((route) => (

              <Route
                key={route.path}
                path={route.path}
                component={route.component}
              />
            ))}
          </Switch>
        </>
      </BrowserRouter>
    </Provider>
  );
}

export default App;
